from fastapi import APIRouter, Depends
from common.common_response import CommonRes, Token
from bean import RegisterParam
from utils import auth
from bean import UserInfo
from service import DataTagService

router = APIRouter(
    prefix="/tag",
    tags=["tag"],
    dependencies=[],
    responses={404: {"description": "Not found"}},
)


@router.get("/list", description="list", response_model=CommonRes)
async def list_tag(name: str=None, current_user: UserInfo = Depends(auth.get_user)):
    data_list = await DataTagService.list_tag(current_user)

    return CommonRes(code=0, message="success", data=data_list)
